window.__require = function t(e, s, a) {
function i(r, l) {
if (!s[r]) {
if (!e[r]) {
var c = r.split("/");
c = c[c.length - 1];
if (!e[c]) {
var h = "function" == typeof __require && __require;
if (!l && h) return h(c, !0);
if (n) return n(c, !0);
throw new Error("Cannot find module '" + r + "'");
}
}
var o = s[r] = {
exports: {}
};
e[r][0].call(o.exports, function(t) {
return i(e[r][1][t] || t);
}, o, o.exports, t, e, s, a);
}
return s[r].exports;
}
for (var n = "function" == typeof __require && __require, r = 0; r < a.length; r++) i(a[r]);
return i;
}({
HotUpdate: [ function(t, e, s) {
"use strict";
cc._RF.push(e, "1824223kJhEzLy2PvYBRrB2", "HotUpdate");
cc.Class({
extends: cc.Component,
properties: {
manifestUrl: cc.Asset,
_updating: !1,
_canRetry: !1,
_storagePath: "",
label: {
default: null,
type: cc.Label
}
},
checkCb: function(t) {
cc.log("Code: " + t.getEventCode());
switch (t.getEventCode()) {
case jsb.EventAssetsManager.ERROR_NO_LOCAL_MANIFEST:
this.label.string = "本地文件丢失";
break;

case jsb.EventAssetsManager.ERROR_DOWNLOAD_MANIFEST:
case jsb.EventAssetsManager.ERROR_PARSE_MANIFEST:
this.label.string = "下载远程mainfest文件错误";
break;

case jsb.EventAssetsManager.ALREADY_UP_TO_DATE:
this.label.string = "已经是最新版本";
break;

case jsb.EventAssetsManager.NEW_VERSION_FOUND:
this.label.string = "有新版本发现，请点击更新";
break;

default:
return;
}
this._am.setEventCallback(null);
this._checkListener = null;
this._updating = !1;
},
updateCb: function(t) {
var e = !1, s = !1;
switch (t.getEventCode()) {
case jsb.EventAssetsManager.ERROR_NO_LOCAL_MANIFEST:
this.label.string = "本地版本文件丢失，无法更新";
s = !0;
break;

case jsb.EventAssetsManager.UPDATE_PROGRESSION:
var a = parseInt(100 * t.getPercent());
Number.isNaN(a) && (a = 0);
this.label.string = "更新进度:" + a;
break;

case jsb.EventAssetsManager.ERROR_DOWNLOAD_MANIFEST:
case jsb.EventAssetsManager.ERROR_PARSE_MANIFEST:
this.label.string = "下载远程版本文件失败";
s = !0;
break;

case jsb.EventAssetsManager.ALREADY_UP_TO_DATE:
this.label.string = "当前为最新版本";
s = !0;
break;

case jsb.EventAssetsManager.UPDATE_FINISHED:
this.label.string = "更新完成. " + t.getMessage();
e = !0;
break;

case jsb.EventAssetsManager.UPDATE_FAILED:
this.label.string = "更新失败. " + t.getMessage();
this._updating = !1;
this._canRetry = !0;
break;

case jsb.EventAssetsManager.ERROR_UPDATING:
this.label.string = "资源更新错误: " + t.getAssetId() + ", " + t.getMessage();
break;

case jsb.EventAssetsManager.ERROR_DECOMPRESS:
this.label.string = t.getMessage();
}
if (s) {
this._am.setEventCallback(null);
this._updateListener = null;
this._updating = !1;
}
if (e) {
this._am.setEventCallback(null);
this._updateListener = null;
var i = jsb.fileUtils.getSearchPaths(), n = this._am.getLocalManifest().getSearchPaths();
cc.log(JSON.stringify(n));
Array.prototype.unshift(i, n);
cc.sys.localStorage.setItem("HotUpdateSearchPaths", JSON.stringify(i));
jsb.fileUtils.setSearchPaths(i);
cc.audioEngine.stopAll();
cc.game.restart();
}
},
retry: function() {
if (!this._updating && this._canRetry) {
this._canRetry = !1;
this.label.string = "重现获取失败资源...";
this._am.downloadFailedAssets();
}
},
checkUpdate: function() {
if (this._updating) this.label.string = "检查更新中..."; else {
this._am.getState() === jsb.AssetsManager.State.UNINITED && this._am.loadLocalManifest(this.manifestUrl);
if (this._am.getLocalManifest() && this._am.getLocalManifest().isLoaded()) {
this._am.setEventCallback(this.checkCb.bind(this));
this._am.checkUpdate();
this._updating = !0;
} else this.label.string = "本地manifest加载失败...";
}
},
hotUpdate: function() {
if (this._am && !this._updating) {
this._am.setEventCallback(this.updateCb.bind(this));
this._am.getState() === jsb.AssetsManager.State.UNINITED && this._am.loadLocalManifest(this.manifestUrl);
this._failCount = 0;
this._am.update();
this._updating = !0;
}
},
onLoad: function() {
var t = this;
if (cc.sys.isNative) {
this._storagePath = (jsb.fileUtils ? jsb.fileUtils.getWritablePath() : "/") + "remote-asset";
cc.log("Storage path for remote asset : " + this._storagePath);
this.versionCompareHandle = function(e, s) {
t.label.string = "Compare: version A is " + e + ", version B is " + s;
for (var a = e.split("."), i = s.split("."), n = 0; n < a.length; ++n) {
var r = parseInt(a[n]), l = parseInt(i[n] || 0);
if (r !== l) return r - l;
}
return i.length > a.length ? -1 : 0;
};
this._am = new jsb.AssetsManager("", this._storagePath, this.versionCompareHandle);
this._am.setVerifyCallback(function(e, s) {
var a = s.compressed, i = s.md5, n = s.path;
s.size;
if (a) {
t.label.string = "Verification passed : " + n;
return !0;
}
t.label.string = "Verification passed : " + n + " (" + i + ")";
return !0;
});
this.label.string = "热更新组件加载完毕，请手动点击检测按钮";
cc.sys.os === cc.sys.OS_ANDROID && this._am.setMaxConcurrentTask(2);
}
},
onDestroy: function() {
if (this._updateListener) {
this._am.setEventCallback(null);
this._updateListener = null;
}
}
});
cc._RF.pop();
}, {} ],
main: [ function(t, e, s) {
"use strict";
cc._RF.push(e, "c95e6DmdstFraJruLsE4SAu", "main");
cc.Class({
extends: cc.Component,
properties: {
testlabel: cc.Label
},
onLoad: function() {},
check: function() {},
gengxin: function() {}
});
cc._RF.pop();
}, {} ]
}, {}, [ "HotUpdate", "main" ]);